﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ST.Buz.Base.Entity;
using ST.Buz.Base.Enums;

namespace ST.Buz.Base.Mapping
{
	public partial class Map_Sys_BuzRowNum : IEntityTypeConfiguration<Sys_BuzRowNum>
	{
		public void Configure(EntityTypeBuilder<Sys_BuzRowNum> builder)
		{
			builder.HasIndex(m => new { m.BuzType, m.Code })
				.HasName("IX_Sys_BuzRowNum_BuzType_Code")
				.IsClustered(false);

			builder.Property(e => e.Current)
				.HasDefaultValueSql("((1))")
				.ValueGeneratedNever();

			builder.Property(e => e.Step)
				.HasDefaultValueSql("((1))")
				.ValueGeneratedNever();

			builder.Property(e => e.Reserved)
				.HasDefaultValueSql("('1')")
				.ValueGeneratedNever();

			builder.Property(e => e.Freezed)
				.HasDefaultValueSql("('0')")
				.ValueGeneratedNever();

			builder.Property(e => e.AddDate)
				.HasDefaultValueSql("(getdate())")
				.ValueGeneratedNever();
		}
	}
}
